UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T+ol2oS9bKLszGVc/gCN41ARDnZTOOoIb0m2i2erdbg=' 
WHERE 
  key_id = '2653daff93b11a24475b8bfc9290fb3e8a7771e9464c8cbf678e4e9c5f2e52cf' 
  AND (
    token = 'T+ol2oS9bKLszGVc/gCN41ARDnZTOOoIb0m2i2erdbg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016