UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sGMUFC7A/EcuveR1qdvLSWWl9O1OwKgOU/5lk0I7T4c=' 
WHERE 
  key_id = 'ecf19b59bdbd61dc606dc98d76906f38f2dd6e35a51ba350be61162760e61fd8' 
  AND (
    token = 'sGMUFC7A/EcuveR1qdvLSWWl9O1OwKgOU/5lk0I7T4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038