UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vMts6EN0wMfmdWX/gbzn0DwJWiNKSeHOj2itCDt4HII=' 
WHERE 
  key_id = '7c5aaeef9ca0d4bfc3c701e36188e444b510a390f6f4d0c4f6b4f5389ce8b7fd' 
  AND (
    token = 'vMts6EN0wMfmdWX/gbzn0DwJWiNKSeHOj2itCDt4HII=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052