UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dzLX9FKaFlGRqEwKZeTUOkmfzpMhxqcd+x+H5+CHgec=' 
WHERE 
  key_id = 'f8f0bced8a42cce9508c62c1b575a1e942e002bdf52f15f1f012eb2d1d255a52' 
  AND (
    token = 'dzLX9FKaFlGRqEwKZeTUOkmfzpMhxqcd+x+H5+CHgec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028