UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AUpOOW83tsO8KYVPpIjUj3g6PYdAg5KPxmYvurjeSk0='
WHERE
key_id = '4a2acb924d2896a3725bf9fedee72835f5597c7b29068b9eafc9a798c55e433e'
AND (
token = 'AUpOOW83tsO8KYVPpIjUj3g6PYdAg5KPxmYvurjeSk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)