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

Query time 0.00035