UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LeWBvYg0lDfU7Eq5JpVGI4wFt1SUcwwP8JcMJgY12KI='
WHERE
key_id = 'ebec1532c9de5b298a815711c7e0866ba494ff8f3945e0be94973a13273bf181'
AND (
token = 'LeWBvYg0lDfU7Eq5JpVGI4wFt1SUcwwP8JcMJgY12KI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)