UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LlDDcn/MX7HLRL+XoGQ9z7ngK2IfK5B7mn+nxvgkEmo='
WHERE
key_id = '3659744bf61a4c7baaa908d2b317ddce079eb658c12a20bd8effa9442b704ebd'
AND (
token = 'LlDDcn/MX7HLRL+XoGQ9z7ngK2IfK5B7mn+nxvgkEmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)