UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ReTslhwAlYyAvxrEjBfCLd6/ZGv+dYR5lXShDV6yyQ='
WHERE
key_id = '0d7e5ed4f67e15411dcb25e589cf30e85f232141f89bdb1254475f5552bc77ef'
AND (
token = '7ReTslhwAlYyAvxrEjBfCLd6/ZGv+dYR5lXShDV6yyQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)