UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gVxQOirAEJJ2wLAP1QTfKX8BxjbahcYt/WHhH6WURRY='
WHERE
key_id = '9836d4ae635277243f444d1438868a2661b21817e34d01d465fd226e6fab5816'
AND (
token = 'gVxQOirAEJJ2wLAP1QTfKX8BxjbahcYt/WHhH6WURRY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)