UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kmtcOCsN5IM5W8G1BWvEZQwKzdbxiMOkWni6RhUNcAo=' 
WHERE 
  key_id = 'c36b0fe4d47bd074b128f9e687e23c608ef5f0cffef96d361dede42dceac1f93' 
  AND (
    token = 'kmtcOCsN5IM5W8G1BWvEZQwKzdbxiMOkWni6RhUNcAo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051