UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rYbfyWKQaOx+ygppKHkSTJe9xEnS93Llj/EwNWpUQCk=' 
WHERE 
  key_id = 'b8946ce2abcbc503d10c8236618197298ebc23c68f57daa65effc57ceda1ce5c' 
  AND (
    token = 'rYbfyWKQaOx+ygppKHkSTJe9xEnS93Llj/EwNWpUQCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067