UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kn+9sSxxdxaz9tXW9ZuJ9AU4R4aLj0Ys8XtsRwhvqdw='
WHERE
key_id = 'ee6d2a9718e6770f34e44e571c87a6c444892d312f666e62e6de3738c154a043'
AND (
token = 'kn+9sSxxdxaz9tXW9ZuJ9AU4R4aLj0Ys8XtsRwhvqdw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)