UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uF4B90Viu9iaRT83C+LsXk8iv+dnmtedfL6eA7+jWzA=' 
WHERE 
  key_id = '724c3929d6bdc9fbeecf53cb3a156e2644dab57ad84bf1fb6796e7483cff2ea9' 
  AND (
    token = 'uF4B90Viu9iaRT83C+LsXk8iv+dnmtedfL6eA7+jWzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054