UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5c1mswGF6TyJ4LAmn8m/MRWUUGFMRV59nnO++ZueOzA=' 
WHERE 
  key_id = '9e393d27f2d13b8894bae965ef8e9fc21bd8eebc233e62cf23e1fa45a8195eeb' 
  AND (
    token = '5c1mswGF6TyJ4LAmn8m/MRWUUGFMRV59nnO++ZueOzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019