UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EukucRjNpF0byluLOy09J1ypv0CNrnmE+EOh4nLqpBw='
WHERE
key_id = '8e62c8bd7d98ec8c6a34cbefd7bb277648a7295c0a92da76b2f4cc671068312b'
AND (
token = 'EukucRjNpF0byluLOy09J1ypv0CNrnmE+EOh4nLqpBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)