UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6TXwZzNquPER02AU0NkE+I0fqaN/J8qMbpf65N2uFDs=' 
WHERE 
  key_id = '781cefeb97d8647ce0df9e51997c7b563f5c0c7eb5debd81e734f8836a61f5c6' 
  AND (
    token = '6TXwZzNquPER02AU0NkE+I0fqaN/J8qMbpf65N2uFDs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038