UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NkTg7nEcpPQep/EdoCE/QyusSvJhzDDIq+pYQRE6Bso='
WHERE
key_id = 'b3e34979ab899a3537850bd7d1a2763ceace52cdd41a8d0387f4b7173c080f90'
AND (
token = 'NkTg7nEcpPQep/EdoCE/QyusSvJhzDDIq+pYQRE6Bso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)