UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qmpw/zpCCEZcsjF99iRAdq0ZrPxRkEbbL8eqslfum/k='
WHERE
key_id = '54442d1cbe559a47db5b887ccc480bd967c2e704b09c4ce9dde7d194bf25affb'
AND (
token = 'qmpw/zpCCEZcsjF99iRAdq0ZrPxRkEbbL8eqslfum/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)