UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fRA6gs7MOZwK+t4H+9HpRRqYpKYRtBRr9lMHyYDpPo8='
WHERE
key_id = 'e15060220d700972d9f39c93152b6a83236e03c3f75ce602ed3c7b3930a73003'
AND (
token = 'fRA6gs7MOZwK+t4H+9HpRRqYpKYRtBRr9lMHyYDpPo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)