UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wQAiWnrJrR6h4i20na+/dNgRBxKV10tnWqsipfAHTtI=' 
WHERE 
  key_id = '039ffe64d5d10745ee65c5daee0d97295bdfe58d565db07d1894492de2cb1dc6' 
  AND (
    token = 'wQAiWnrJrR6h4i20na+/dNgRBxKV10tnWqsipfAHTtI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025