UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ztijBn+PQCHmnw5ZS12g52KPjledEZzRs/g7Ray8rA='
WHERE
key_id = '53a0788cae7c5c365d957b011e50aeb3d3bc3334b2120a103c98ecb71e2239a6'
AND (
token = '2ztijBn+PQCHmnw5ZS12g52KPjledEZzRs/g7Ray8rA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)