UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jJU7oxdDmq+xoPejQTZRL4Ue10LtvF1BWJv57uitfak='
WHERE
key_id = 'a920b811320d666f75709f8f759b882bb3daa9a6a704be316f4b9c102ca2cd43'
AND (
token = 'jJU7oxdDmq+xoPejQTZRL4Ue10LtvF1BWJv57uitfak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)