UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jXuJtSSYstMfLXDaD/mdgQYN7gMUQrdoN4YBpqNzjqU=' 
WHERE 
  key_id = 'bd326059c32b08a3385b8a6a842f35caeb89e778120aadc286e83d58934b35c3' 
  AND (
    token = 'jXuJtSSYstMfLXDaD/mdgQYN7gMUQrdoN4YBpqNzjqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064