UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AasiEiQGYpG6/PR/e46evCVdaMapALbW9pkCPDhrB0w='
WHERE
key_id = 'e2567961ac1bd9b548db039b342d412d689ef12f39a229500947b37d0011ea5e'
AND (
token = 'AasiEiQGYpG6/PR/e46evCVdaMapALbW9pkCPDhrB0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)