UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tTONSl8QYXyG+d5TiSZULlQl0lnuznri0oBh7Megmvc='
WHERE
key_id = 'c04e07faeddb385239b48443f785964893481fabf336dad320696958caa22655'
AND (
token = 'tTONSl8QYXyG+d5TiSZULlQl0lnuznri0oBh7Megmvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)