UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5sytw9r7poQYdZotOT+ARvSUtZLy40BmDu5uenYruOM='
WHERE
key_id = 'ffbd5d1050c684ac3619f57e8022ebf2f4b4ec81ce092d2ab19df4be0abefe74'
AND (
token = '5sytw9r7poQYdZotOT+ARvSUtZLy40BmDu5uenYruOM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)