UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HPlCysDruo68tjMEKSGT/5LeEcUr9CIy1wgs4XAD+d8='
WHERE
key_id = '6ee8c6b759053712b99f68354efba8b155d3be86832133d36ecc996bcd7e1395'
AND (
token = 'HPlCysDruo68tjMEKSGT/5LeEcUr9CIy1wgs4XAD+d8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)