UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zl72CZX74k/Iq5+oILhNA8GUiZp0LfUmp9RZAPeaaxY=' 
WHERE 
  key_id = 'f3b5d245365eac3f6d42729747422b7fbc1c7e749116fe2e8cefa54db3584aea' 
  AND (
    token = 'zl72CZX74k/Iq5+oILhNA8GUiZp0LfUmp9RZAPeaaxY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035