UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'arhIIZKishe5p1gRZdCY2kgBA5hfE5cbC4PalIABdRs='
WHERE
key_id = '2756a88ff2174946ec40c67956dceabe82a6721e04db60a15d047ff50c5293ae'
AND (
token = 'arhIIZKishe5p1gRZdCY2kgBA5hfE5cbC4PalIABdRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)