UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j/UU7ZAINAzVC826793e4TNUpZjW0KIc3pIuvSCTLKQ=' 
WHERE 
  key_id = '18995bf9aeaead7c186c465581677663aa23216ad22296d2be9a0f6861e9c230' 
  AND (
    token = 'j/UU7ZAINAzVC826793e4TNUpZjW0KIc3pIuvSCTLKQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029