UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BcVYPwXclLuPliPB07QtrnSJCTs6xmsuvVHbB7f/LFg='
WHERE
key_id = '5eb1bdccab2451b47d12ac976843f29f3986b2d48be2a229638b8d86519ffd23'
AND (
token = 'BcVYPwXclLuPliPB07QtrnSJCTs6xmsuvVHbB7f/LFg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)