UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3bLSqwwGA5yV8rTKLHMBhAsoo1RchM85EEExUlV0ny0=' 
WHERE 
  key_id = '56e6ae0238514bd8c7c3fbb06a6d1ad0a8170b75e427ef8e95c1579b88d37994' 
  AND (
    token = '3bLSqwwGA5yV8rTKLHMBhAsoo1RchM85EEExUlV0ny0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029